#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <string>
#include "comm.hpp"

int main()
{
    int fd = open(filename, O_WRONLY);
    if (fd < 0)
    {
        perror("open");
        return 1;
    }

    std::string buffer;
    while (true)
    {
        std::getline(std::cin, buffer);
        write(fd, buffer.c_str(), buffer.size());
        if (buffer == "quit")
        {
            break;
        }
    }

    close(fd);

    return 0;
}